package demo1;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * Date: 2023-05-13
 * Time: 23:48
 */
abstract class Animal{
    public String name;
    public int age;
    /*public Animal(){

    }*/
    public Animal(String name,int age){
        this.name = name;
        this.age = age;
    }
    public abstract void eat();
}
class Dog extends Animal{
    /*public Dog(){
        super("小黄",10);
    }*/
    public Dog(String name,int age){
        super(name,age);
    }
    @Override
    public void eat() {
        System.out.println(name+" 吃狗粮！");
    }
}
public class Test {
    public static void main(String[] args) {
        //Animal animal = new Animal();\
        Dog dog = new Dog("abc",10);
    }
}
